    Help for PicBtn

Properties            Events            Frequently Asked Questions

Registration Information

Order Form

Getting Custom Controls Written

Licensing Information

Description

This custom control for Visual Basic is a command button that has both text and a picture on it.  The picture can be scaled and placed above, below, to the right, or to the left of the text.  The text may be multi-line.

File Name

PICBTN1.VBX, PICBTN16.OCX, PICBTN32.OCX

ActiveX / OCX Object Name

Mabry.PicBtnCtrl

ActiveX Compatility

VB 4.0 (32-bit) and 5.0

ActiveX Built With

Microsoft Visual C++ v4

ActiveX - Required DLLs

MFC40.DLL (October 6th, 1995 or later)

OLEPRO32.DLL  (October 6th, 1995 or later)

MSVCRT40.DLL  (September 29th, 1995 or later)

VBX Object Type

MabryPictureButton

VBX Compatibility

VB 1.0, 2.0, 3.0 and 4.0 (16-bit)

VBX Built With

Microsoft Visual C++ v1.5

Usage Note

The Caption property can contain multiple lines of text.  You can delimit each line with either a carriage return (Chr(13)) or a vertical bar (Chr(124)).  Using the vertical bar will allow you to specify multiple lines of text at design-time.

Distribution Note    When you develop and distribute an application that uses this control, you should install the control file into the user's Windows SYSTEM directory.  The control file has version information built into it.  So, during installation, you should ensure that you are not overwriting a newer version.


PicBtn Property Page

Click on the dialog box (below) in the field you need help for.


PicBtn Properties

Properties that have special meaning for this control or that only apply to this control are marked with an asterisk (*).

*Appearance Property

*AutoSize Property

BackColor Property

*ButtonColor Property

Caption Property

DragIcon Property

Enabled Property

*Font3D Property

FontBold Property

FontItalic Property

FontName Property

FontSize Property

FontStrikethru Property

FontUnderline Property

*Gap Property

Height Property

HelpContextID Property

hWnd Property

Index Property

Left Property

*Mode Property

*MouseFocus Property

MousePointer Property

Name Property

Parent Property

*PictureDisabled Property

*PictureDown Property

*PictureUp Property

*Placement Property

TabIndex Property

TabStop Property

Tag Property

Top Property

*Value Property

*Version Property

Visible Property

Width Property


PicBtn Events

Events that have special meaning for this control or that only apply to this control are marked with an asterisk (*).

Click Event

DragDrop Event

DragOver Event

GotFocus Event

KeyDown Event

KeyPress Event

KeyUp Event

LostFocus Event

MouseDown Event

MouseMove Event

MouseUp Event


Frequently Asked Questions

General Questions

I want to display a Form when the user presses a button.  The button needs to remain "pressed" while the Form is displayed and "unpressed" when the button is pressed a second time to remove the Form.  How can I do this?


FAQ - I want to display a Form when the user presses a button.  The button needs to remain "pressed" while
I want to display a Form when the user presses a button.  The button needs to remain "pressed" while the Form is displayed and "unpressed" when the button is pressed a second time to remove the Form.  How can I do this?

Frequently Asked Questions

Set the Mode property of PicBtn to Toggle mode and use the following code (note -- if the displayed Form allows the user to close the Form manually, you'll need to trap either the QueryUnload or Unload event and adjust the state of the button):

Private Sub PicBtn1_Click()
    If PicBtn1.Value Then
        Form2.Show
    Else
        Form2.Hide
    End If
End Sub


Registration Information

CREDITS

PicBtn was written by James Shields.

CONTACT INFORMATION

Orders, inquiries, technical support, questions, comments, etc. can be sent to mabry@mabry.com on the Internet.  Our mailing address/contact information is:

Mabry Software, Inc.

Post Office Box 31926

Seattle, WA  98103-1926

Sales: 1-800-99-MABRY (U.S. Only)

Voice: 206-634-1443

Fax: 206-632-0272 or 206-364-3196

Web: http://www.mabry.com

COST

The price of PicBtn (control only) is US$15 (US$20 for International orders).  The cost of PicBtn and the C/C++ source code (of the control itself) is US$50 (US$55 for International orders).

Prices are subject to change without notice.

DELIVERY METHODS

We can ship this software to you via air mail and/or e-mail.

Air Mail - you will receive disks, a printed manual, and printed receipt if you choose this delivery method.  The costs are:

US$5.00 	US Priority Mail

US$10.00 	AirBorne Express 2nd Day (US deliveries only)

US$15.00 	AirBorne Express Overnight (US deliveries only)

US$45.00 	International AirBorne Express.

E-Mail - We can ship this package to you via e-mail.  You need to have an e-mail account that can accept large file attachments (which includes CompuServe, AOL, and most Internet providers).  If you choose this option, please note: a printed manual is not included.  We will, however, e-mail a receipt to you.

Be sure to include your full mailing address with your order.  Sometimes (on the Internet) the package cannot be e-mailed, so we are forced to send it through the normal mails.

CompuServe E-Mail - CompuServe members can use the software registration forum (GO SWREG) to register this package.  PicBtn's SWREG ID number is 3434.  The source code version's ID number is 3435.  PLEASE NOTE: When you order through SWREG, we send the registered package to your CompuServe account (not your Internet or AOL account) within a few hours.

ORDER / PAYMENT METHODS

You can order this software by phone, fax, e-mail, mail.  For your convenience, an order form has been provided that you can print out directly from this help file.

Please note that orders must include all information that is requested on our order form.   Your shipment WILL BE DELAYED if we have to contact you for additional information (such as phone number, street address, etc.).

You can pay by credit card (VISA, MasterCard, American Express), check (U.S. dollars drawn on a U.S. bank), cash, International Money Order, International Postal Order, Purchase Order (established business entities only - terms net 30), or wire transfer.

WIRE TRANSFER INFORMATION

Here is the information you need regarding our account for a wire funds transfer:

Bank Name: 	SeaFirst - Stone Way Branch

Bank Address: 	3601 Stone Way North

Seattle, WA  98103

Bank Phone: 	206-585-4951

Account Name: 	Mabry Software, Inc.

Routing Number: 	12000024

Account Number: 	16311706

If you are paying with a wire transfer of funds, please add US$12.50 to your order.  This is the fee that SeaFirst Bank charges Mabry Software.  Also, please ADD ANY ADDITIONAL FEES THAT YOUR BANK MAY CHARGE for wire transfer service. If you are paying with a  wire transfer, we must have full payment deposited to our account before we can ship your order.

Copyright © 1995-1997 by Mabry Software, Inc.


Order Form
 PicBtn Order Form

Use the Print Topic... command from the File menu to print this order form.

Mail this 	Mabry Software, Inc.

form to: 	Post Office Box 31926

Seattle, WA  98103-1926

Phone: 206-634-1443

Fax: 206-632-0272 or 206-364-3196

Internet: mabry@mabry.com

Web: www.mabry.com

Where did you get this copy of PicBtn?

____________________________________________________________________

Name: 	____________________________________________________________________

Ship to: 	____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

Phone: 	_________________________________________________________________

Fax: 	_________________________________________________________________

E-Mail: 	_________________________________________________________________

MC/VISA/AMEX: _________________________________________ exp. __________________

P.O. # (if any): 	____________________ Signature ____________________________________

qty ordered 	____ 	REGISTRATION
$15.00 ($20.00 international).  Check or money order in U.S. currency drawn on a U.S. bank.  Add $5.00 per order for shipping and handling.

qty ordered 	____ 	SOURCE CODE AND REGISTRATION
$50.00 ($55.00 international).  Check or money order in U.S. currency drawn on a U.S. bank.  Add $5.00 per order for shipping and handling.


AutoSize, Gap, and Placement Properties Example

In this example, the program will show what happens when you adjust the various visual properties. To try this example, paste the code into the Declarations section of a form that contains a horizontal scroll bar (for Gap), a check box (for AutoSize), a command button (for Placement), and a PicBtn (with the PictureUp property set to a bitmap).  Press F5.  Play with the various controls.

Sub Check1_Click ()
    PicBtn1.AutoSize = Check1.Value
End Sub

Sub Command1_Click ()
    Select Case Val(Left(Command1.Caption, 1))
        Case 0:
        Command1.Caption = "1 - Above text"
        PicBtn1.Placement = 1
        Case 1:
            Command1.Caption = "2 - Right of text"
            PicBtn1.Placement = 2
        Case 2:
            Command1.Caption = "3 - Below text"
            PicBtn1.Placement = 3
        Case 3:
            Command1.Caption = "0 - Left of text"
        PicBtn1.Placement = 0
    End Select
End Sub

Sub Form_Load ()
    Form1.Caption = "PicBtn Sample #1"
    Form1.Height = 3120
    Form1.Width = 3000

    Check1.Top = 240
    Check1.Left = 240
    Check1.Width = 1800
    Check1.Caption = "AutoSize"
    Check1.Value = 1

    HScroll1.Top = 600
    HScroll1.Left = 240
    HScroll1.Width = 1800
    HScroll1.Value = 6
    HScroll1.Min = 0
    HScroll1.Max = 20

    Command1.Top = 960
    Command1.Left = 240

    Command1.Height = 480
    Command1.Width = 1800
    Command1.Caption = "0 - Left of text"

    PicBtn1.Top = 1560
    PicBtn1.Left = 240
    PicBtn1.Width = 2400
    PicBtn1.Height = 900
End Sub

Sub HScroll1_Change ()
    PicBtn1.Gap = HScroll1.Value
End Sub


Appearance Property See Also
See Also

Font3D Property

Placement Property


AutoSize Property See Also
See Also

Gap Property

PictureDisabled Property

PictureDown Property

PictureUp Property

Placement Property


ButtonColor Property See Also
See Also

AutoSize Property

Font3D Property


Font3D Property See Also
See Also

Appearance Property

ButtonColor Property


Gap Property See Also
See Also

AutoSize Property

PictureDisabled Property

PictureDown Property

PictureUp Property

Placement Property


Mode Property See Also
See Also

Value Property


MouseFocus Property See Also
See Also

Appearance Property


PictureDisabled Property See Also
See Also

AutoSize Property

Gap Property

PictureDown Property

PictureUp Property

Placement Property


PictureUp Property See Also
See Also

AutoSize Property

Gap Property

PictureDown Property

Placement Property


Placement Property See Also
See Also

AutoSize Property

Gap Property

PictureDisabled Property

PictureDown Property

PictureUp Property


Value Property See Also
See Also

Mode Property


Appearance Property

See Also            Frequently Asked Questions

Description

Selects the style of the button.

Syntax

object.Appearance [= integer ]

The syntax of the Appearance property has these parts:

Part	   	Description

object	A PicBtn control.

integer	An integer that determines the style of the button.

Remarks

Appearance determines what style of look that PicBtn uses.  This property may be one of these values:

Constant	   	Value	   	Description

mPicBtnFlat	0	Button looks like Windows 3.x command buttons.

mPicBtn3D	1	Button looks like Windows 95 command buttons.

Data Type

Integer (enumerated)


AutoSize Property

See Also            AutoSize, Gap, and Placement Properties Example            Frequently Asked Questions

Description

Determines whether the bitmap is automatically resized to fit the button.

Syntax

object.AutoSize [= boolean ]

The syntax of the AutoSize property has these parts:

Part	   	Description

object	A PicBtn control.

boolean	A boolean expression that determines if the bitmap is automatically resized to fit.

Remarks

If this property is set to True, the bitmap(s) used for the button is automatically resized to fit the button.  All three supported picture types may be resized.

Data Type

Integer (boolean)


ButtonColor Property

See Also            Frequently Asked Questions

Description

Determines the color of the surface of the button.

Syntax

object.ButtonColor [= color ]

The syntax of the ButtonColor property has these parts:

Part	   	Description

object	A PicBtn control.

color	A color that determines the button's face color.

Remarks

This property determines the color of the surface of the button.  It defaults to light gray.

Data Type

Color


Font3D Property

See Also            Frequently Asked Questions

Description

Specifies the 3-D appearance of the selected font.

Syntax

object.Font3D [= integer ]

The syntax of the Font3D property has these parts:

Part	   	Description

object	A PicBtn control.

integer	An integer that determines the style of 3-D fonts to use, if any.

Remarks

This property specifies how the button acts. PicBtn can act like a normal button or a toggle button (for tool bars, etc.).  This property may be one of these values:

Constant	   	Value	   	Description

mPicBtnNone	0	Normal (default) - The text is displayed normally.

mPicBtnRaisedLight	1	Raised text with a light shadow.

mPicBtnRaisedHeavy	2	Raised text with a heavy shadow.

mPicBtnInsetLight	3	Lowered text with a light shadow.

mPicBtnInsetHeavy	4	Raised text with a heavy shadow.

Data Type

Integer (enumerated)


Gap Property

See Also            AutoSize, Gap, and Placement Properties Example            Frequently Asked Questions

Description

Determines the distance between the edges, the bitmap, and the text.

Syntax

object.Gap [= integer ]

The syntax of the Gap property has these parts:

Part	   	Description

object	A PicBtn control.

integer	An integer that determines the number of pixels between the edge of the border and the bitmap / text.

Remarks

The value of this property determines the minimum distance between the edge and the bitmap.  It also determines the distance between the bitmap and the text.  This property is expressed in pixels.

This property defaults to 6.

Data Type

Integer


Mode Property

See Also            Frequently Asked Questions

Description

Determines the way the button raises and lowers.

Syntax

object.Mode [= integer ]

The syntax of the Mode property has these parts:

Part	   	Description

object	A PicBtn control.

integer	An integer that determines the way the button works.

Remarks

This property specifies how the button acts. PicBtn can act like a normal button or a toggle button (for tool bars, etc.).  This property may be one of these values:

Constant	   	Value	   	Description

mPicBtnNormal	0	Normal (default) - PicBtn depresses when the button is pressed and rises when the button is released.

mPicBtnToggle	1	Toggle - the button depresses on the first click, and rises on the second click.  PicBtn will also change state via the Value property.

mPicBtnManual	2	Manual - PicBtn only changes state when set via the Value property.

Data Type

Integer (enumerated)


MouseFocus Property

See Also            Frequently Asked Questions

Description

Determines if the control will receive focus.

Syntax

object.MouseFocus [= boolean ]

The syntax of the MouseFocus property has these parts:

Part	   	Description

object	A PicBtn control.

boolean	A boolean expression that determines if the control will get focus when clicked on.

Remarks

This property determines whether or not the button will receive focus when clicked on with the mouse.  If this property is set to False, the focus will remain with the previous control when the user clicks on the button with the mouse.  If it is set to True, then the focus shifts to this control when the user clicks on it.

This is especially useful with toolbars where you don't want it to receive focus when clicked on.  The button can still receive focus if the user tabs to it.

Data Type

Integer (boolean)


PictureDisabled Property

See Also            Frequently Asked Questions

Description

Determines the picture used for the control.

Syntax

object.PictureDisabled [= picture ]

The syntax of the PictureDisabled property has these parts:

Part	   	Description

object	A PicBtn control.

picture	A picture that is used on the face of the control when the control is disabled.

Remarks

This property determines the appearance of the control when Enabled is set to False.  You can use this property to give the bitmap a special look when disabled.  Otherwise, PicBtn will automatically create disabled bitmaps from the PictureUp and PictureDown properties.

This propertiy can be a bitmap, icon, or Windows meta file.  PicBtn will stretch or shrink any of these, if needed.

Data Type

Picture


PictureDown and PictureUp Properties

See Also            Frequently Asked Questions

Description

Determines the picture used for the control.

Syntax

object.PictureDown [= picture ]
object.PictureUp [= picture ]

The syntax of the PictureDown and PictureUp properties has these parts:

Part	   	Description

object	A PicBtn control.

picture	A picture that is used on the face of the control.

Remarks

The value of these properties determine the pictures that are displayed on the button.  PictureUp is the bitmap thats displayed when the button is up; PictureDown is displayed when the button is down.

If PictureDown is not set, PictureUp is used.  If neither is set, the button does not display bitmaps at all (i.e., it is text-only).

These properties can be bitmaps, icons, or Windows meta files.  PicBtn will stretch or shrink any of these, if needed.

Data Type

Picture


Placement Property

See Also            AutoSize, Gap, and Placement Properties Example            Frequently Asked Questions

Description

Determines the position of the picture relative to the text.

Syntax

object.Placement [= integer ]

The syntax of the Placement property has these parts:

Part	   	Description

object	A PicBtn control.

integer	An integer that determines the placement of the bitmap relative to the text.

Remarks

The value of this property determines the placement of the bitmap in relation to the text.  This property is ignored if PictureDown is not set.

This property may be one of five values:

Constant	   	Value	   	Description

mPicBtnLeft	0	Left of text (default)

mPicBtnAbove	1	Above text

mPicBtnRight	2	Right of text

mPicBtnBelow	3	Below text

mPicBtnCenter	4	Center of button (no text)

Data Type

Integer (enumerated)


Value Property

See Also            Frequently Asked Questions

Description

Determines the state of the control (up or down).

Syntax

object.Value [= boolean ]

The syntax of the Value property has these parts:

Part	   	Description

object	A PicBtn control.

boolean	A boolean expression that determines the state of the button.

Remarks

This property is True when the button is depressed and False when the button is raised.

When Mode is zero (Normal), the Click event is fired when this property is set to non-zero.  In all other modes, the Click event is fired whenever this property is changed.

Data Type

Integer (boolean)


Version Property

Frequently Asked Questions

Description

Shows the version of the control.

Syntax

object.Version

The syntax of the Version property has these parts:

Part	   	Description

object	A PicBtn control.

Remarks

This property holds the current version of the control.  It is read-only and available at both design-time and run-time.

Data Type

String


Getting Custom Controls Written

If you or your organization would like to have custom controls written, you can contact us at the following:

Mabry Software, Inc.

Post Office Box 31926

Seattle, WA  98103-1926

Phone: 206-634-1443

Fax: 206-632-0272 or 206-364-3196

Internet: mabry@mabry.com

You can also contact Zane Thomas.  He can be reached at:

Zane Thomas

Post Office Box 121

Indianola, WA  98342

Internet: zane@mabry.com


Licensing Information

Legalese Version

Mabry Software grants a license to use the enclosed software to the original purchaser.  Copies may be made for back-up purposes only.  Copies made for any other purpose are expressly prohibited, and adherence to this requirement is the sole responsibility of the purchaser.

Customer written executable applications containing embedded Mabry products may be freely distributed, without royalty payments to Mabry Software, provided that such distributed Mabry product is bound into these applications in such a way so as to prohibit separate use in design mode, and that such Mabry product is distributed only in conjunction with the customers own software product.  The Mabry Software product may not be distributed by itself in any form.

Neither source code for Mabry Software products nor modified source code for Mabry Software products may be distributed under any circumstances, nor may you distribute .OBJ, .LIB, etc. files that contain our routines. This control may be used as a constituent control only if the compound control thus created is distributed with and as an integral part of an application.  Permission to use this control as a constituent control does not grant a right to distribute the license (LIC) file or any other file other than the control executable itself. This license may be transferred to a third party only if all existing copies of the software and its documentation are also transferred.

This product is licensed for use by only one developer at a time.  Mabry Software expressly prohibits installing this product on more than one computer if there is any chance that both copies will be used simultaneously.  This restriction also extends to installation on a network server, if more than one workstation will be accessing the product.  All developers working on a project which includes a Mabry Software product, even though not working directly with the Mabry product, are required to purchase a license for that Mabry product.

This software is provided as is.  Mabry Software makes no warranty, expressed or implied, with regard to the software.  All implied warranties, including the warranties of merchantability and fitness for a particular use, are hereby excluded.

MABRY SOFTWARE'S LIABILITY IS LIMITED TO THE PURCHASE PRICE.  Under no circumstances shall Mabry Software or the authors of this product be liable for any incidental or consequential damages, nor for any damages in excess of the original purchase price.

To be eligible for free technical support by telephone, the Internet, CompuServe, etc. and to ensure that you are notified of any future updates, please complete the enclosed registration card and return it to Mabry Software.

English Version

We require that you purchase one copy of a control per developer on a project.  If this is met, you may distribute the control with your application royalty free.  You may never distribute the LIC file.  You may not change the product in any way that removes or changes the requirement of a license file.

We encourage the use of our controls as constituent controls when the compound controls you create are an integral part of your application.  But we don't allow distribution of our controls as constituents of other controls when the compound control is not part of an application.  The reason we need to have this restriction is that without it someone might decide to use our control as a constituent, add some trivial (or even non-trivial) enhancements and then sell the compound control.  Obviously there would be little difference between that and just plain reselling our control.

If you have purchased the source code, you may not re-distribute the source code either (nor may you copy it into your own project).  Mabry Software retains the copyright to the source code.

Your license is transferable.  The original purchaser of the product must make the transfer request.  Contact us for further information.

The sample versions of our products are intended for evaluation purposes only.  You may not use the sample version to develop completed applications.